﻿using System;

namespace ReadyApps.Wiki
{
    /// <summary>
    /// Represents the available permissions for the wiki control.
    /// </summary>
    [Flags]
    public enum WikiPermissions
    {
        /// <summary>
        /// No permissions available.
        /// </summary>
        None = 0x00,

        /// <summary>
        /// The user can view the wiki page.
        /// </summary>
        ViewPage = 0x01,

        /// <summary>
        /// The user can edit the wiki page content.
        /// </summary>
        EditPage = 0x02,

        /// <summary>
        /// The user can create and delete pages.
        /// </summary>
        CreatePage = 0x04,

        /// <summary>
        /// The user can create and delete folders.
        /// </summary>
        CreateFolder = 0x08,

        /// <summary>
        /// The user can edit the permissions on the wiki page.
        /// </summary>
        EditPermissions = 0x10,

        /// <summary>
        /// The user can manage the revisions on the wiki page.
        /// </summary>
        ManageRevisions = 0x20,

        /// <summary>
        /// The user can manage publication settings and publish content.
        /// </summary>
        ManagePublishing = 0x40,

        /// <summary>
        /// The privileges that are only applicable to folders.
        /// </summary>
        FolderLevelPrivileges = CreatePage | CreateFolder,

        /// <summary>
        /// The privileges that are applicable to individual pages.
        /// </summary>
        PageLevelPrivileges = ViewPage | EditPage | ManageRevisions | ManagePublishing | EditPermissions,

        /// <summary>
        /// All available privileges.
        /// </summary>
        AllPrivileges = 0xFF
    }

    /// <summary>
    /// Represents the different states that a wiki page may be in.
    /// </summary>
    enum WikiPageMode
    {
        Unknown,
        ViewPage,
        EditPage,
        CreatePage,
        EditPermissions,
        ViewRevisionList,
        ViewPageRevision,
        ViewPagePending,
        PageSettings
    }

    /// <summary>
    /// Represents the different types of includes that may be requested by
    /// the wiki controller.
    /// </summary>
    enum IncludeType
    {
        ScriptFile,
        ScriptBlock,
        Stylesheet
    }
}